﻿<!--
  
   GiftEditor.xaml
  
   Copyright (c) 2007 Mike Strobel
  
   This source code is subject to the terms of the Microsoft Reciprocal License (Ms-RL).
   For details, see <http://www.opensource.org/licenses/ms-rl.html>.
  
   All other rights reserved.
  
  -->
<UserControl x:Class="Supremacy.Client.GiftEditor"
             xmlns="http://schemas.microsoft.com/netfx/2007/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:s="http://schemas.startreksupremacy.com/xaml/core"
             xmlns:scc="http://schemas.startreksupremacy.com/xaml/presentation"
             xmlns:al="clr-namespace:Avalon.Windows.Controls;assembly=AvalonLibrary"
             xmlns:local="clr-namespace:Supremacy.Client"
             MinWidth="480">
  <al:AutoGrid ChildMargin="3"
               Orientation="Vertical">
    <al:AutoGrid.ColumnDefinitions>
      <ColumnDefinition Width="Auto" />
      <ColumnDefinition Width="*" />
      <ColumnDefinition Width="Auto" />
    </al:AutoGrid.ColumnDefinitions>
    <TextBlock FontFamily="{StaticResource ParagraphFont}"
               FontSize="12pt"
               Foreground="{StaticResource DefaultTextBrush}"
               Text="{s:StringResource CREDITS}"
               VerticalAlignment="Center" />
    <DockPanel>
      <RepeatButton DockPanel.Dock="Left"
                    Margin="0,0,2,0"
                    Command="{x:Static s:BlockBar.DecrementCommand}"
                    CommandTarget="{Binding ElementName=CreditsSlider}"
                    Focusable="False"
                    Delay="150"
                    Interval="50"
                    IsTabStop="False"
                    SnapsToDevicePixels="True"
                    Style="{StaticResource BlockBarDecrementButtonStyle}" />
      <RepeatButton DockPanel.Dock="Right"
                    Margin="2,0,0,0"
                    Command="{x:Static s:BlockBar.IncrementCommand}"
                    CommandTarget="{Binding ElementName=CreditsSlider}"
                    Focusable="False"
                    Delay="150"
                    Interval="50"
                    IsTabStop="False"
                    SnapsToDevicePixels="True"
                    Style="{StaticResource BlockBarIncrementButtonStyle}" />
      <s:BlockBar x:Name="CreditsSlider"
                  DockPanel.Dock="Top"
                  BlockCount="40"
                  BlockMargin="2"
                  Minimum="0"
                  Maximum="999999999"
                  Value="{Binding Path=GiftDetails.Credits, Mode=TwoWay}" />
    </DockPanel>
    <TextBlock FontFamily="{StaticResource ParagraphFont}"
               FontSize="12pt"
               Foreground="{StaticResource DefaultTextBrush}"
               MinWidth="42"
               Text="{Binding ElementName=CreditsSlider, Path=Value, Mode=OneWay, Converter={StaticResource WholeCurrencyFormatConverter}}"
               VerticalAlignment="Center" />
    <TextBlock FontFamily="{StaticResource ParagraphFont}"
               FontSize="12pt"
               Foreground="{StaticResource DefaultTextBrush}"
               Text="{s:StringResource RAW_MATERIALS}"
               VerticalAlignment="Center" />
    <DockPanel>
      <RepeatButton DockPanel.Dock="Left"
                    Margin="0,0,2,0"
                    Command="{x:Static s:BlockBar.DecrementCommand}"
                    CommandTarget="{Binding ElementName=RawMaterialsSlider}"
                    Focusable="False"
                    Delay="150"
                    Interval="50"
                    IsTabStop="False"
                    SnapsToDevicePixels="True"
                    Style="{StaticResource BlockBarDecrementButtonStyle}" />
      <RepeatButton DockPanel.Dock="Right"
                    Margin="2,0,0,0"
                    Command="{x:Static s:BlockBar.IncrementCommand}"
                    CommandTarget="{Binding ElementName=RawMaterialsSlider}"
                    Focusable="False"
                    Delay="150"
                    Interval="50"
                    IsTabStop="False"
                    SnapsToDevicePixels="True"
                    Style="{StaticResource BlockBarIncrementButtonStyle}" />
      <s:BlockBar x:Name="RawMaterialsSlider"
                  DockPanel.Dock="Top"
                  BlockCount="40"
                  BlockMargin="2"
                  Minimum="0"
                  Maximum="999999999"
                  Value="{Binding Path=GiftDetails.Resources[RawMaterials], Mode=TwoWay}" />
    </DockPanel>
    <TextBlock FontFamily="{StaticResource ParagraphFont}"
               FontSize="12pt"
               Foreground="{StaticResource DefaultTextBrush}"
               MinWidth="42"
               Text="{Binding ElementName=RawMaterialsSlider, Path=Value, Mode=OneWay, Converter={StaticResource WholeCurrencyFormatConverter}}"
               VerticalAlignment="Center" />
    <TextBlock FontFamily="{StaticResource ParagraphFont}"
               FontSize="12pt"
               Foreground="{StaticResource DefaultTextBrush}"
               Text="{s:StringResource DEUTERIUM}"
               VerticalAlignment="Center" />
    <DockPanel>
      <RepeatButton DockPanel.Dock="Left"
                    Margin="0,0,2,0"
                    Command="{x:Static s:BlockBar.DecrementCommand}"
                    CommandTarget="{Binding ElementName=DeuteriumSlider}"
                    Focusable="False"
                    Delay="150"
                    Interval="50"
                    IsTabStop="False"
                    SnapsToDevicePixels="True"
                    Style="{StaticResource BlockBarDecrementButtonStyle}" />
      <RepeatButton DockPanel.Dock="Right"
                    Margin="2,0,0,0"
                    Command="{x:Static s:BlockBar.IncrementCommand}"
                    CommandTarget="{Binding ElementName=DeuteriumSlider}"
                    Focusable="False"
                    Delay="150"
                    Interval="50"
                    IsTabStop="False"
                    SnapsToDevicePixels="True"
                    Style="{StaticResource BlockBarIncrementButtonStyle}" />
      <s:BlockBar x:Name="DeuteriumSlider"
                  DockPanel.Dock="Top"
                  BlockCount="40"
                  BlockMargin="2"
                  Minimum="0"
                  Maximum="999999999"
                  Value="{Binding Path=GiftDetails.Resources[Deuterium], Mode=TwoWay}" />
    </DockPanel>
    <TextBlock FontFamily="{StaticResource ParagraphFont}"
               FontSize="12pt"
               Foreground="{StaticResource DefaultTextBrush}"
               MinWidth="42"
               Text="{Binding ElementName=DeuteriumSlider, Path=Value, Mode=OneWay, Converter={StaticResource WholeCurrencyFormatConverter}}"
               VerticalAlignment="Center" />
    <TextBlock FontFamily="{StaticResource ParagraphFont}"
               FontSize="12pt"
               Foreground="{StaticResource DefaultTextBrush}"
               Text="{s:StringResource DILITHIUM}"
               VerticalAlignment="Center" />
    <DockPanel>
      <RepeatButton DockPanel.Dock="Left"
                    Margin="0,0,2,0"
                    Command="{x:Static s:BlockBar.DecrementCommand}"
                    CommandTarget="{Binding ElementName=DilithiumSlider}"
                    Focusable="False"
                    Delay="150"
                    Interval="50"
                    IsTabStop="False"
                    SnapsToDevicePixels="True"
                    Style="{StaticResource BlockBarDecrementButtonStyle}" />
      <RepeatButton DockPanel.Dock="Right"
                    Margin="2,0,0,0"
                    Command="{x:Static s:BlockBar.IncrementCommand}"
                    CommandTarget="{Binding ElementName=DilithiumSlider}"
                    Focusable="False"
                    Delay="150"
                    Interval="50"
                    IsTabStop="False"
                    SnapsToDevicePixels="True"
                    Style="{StaticResource BlockBarIncrementButtonStyle}" />
      <s:BlockBar x:Name="DilithiumSlider"
                  DockPanel.Dock="Top"
                  BlockCount="40"
                  BlockMargin="2"
                  Minimum="0"
                  Maximum="999999999"
                  Value="{Binding Path=GiftDetails.Resources[Dilithium], Mode=TwoWay}" />
    </DockPanel>
    <TextBlock FontFamily="{StaticResource ParagraphFont}"
               FontSize="12pt"
               Foreground="{StaticResource DefaultTextBrush}"
               MinWidth="42"
               Text="{Binding ElementName=DilithiumSlider, Path=Value, Mode=OneWay, Converter={StaticResource WholeCurrencyFormatConverter}}"
               VerticalAlignment="Center" />
    <local:DurationEditor x:Name="DurationEditor"
                          Grid.ColumnSpan="3"
                          HorizontalAlignment="Center"
                          MinDuration="1"
                          Duration="{Binding Path=Duration, Mode=TwoWay}"
                          Margin="0,7,0,0" />
    <StackPanel Grid.ColumnSpan="3"
                Orientation="Horizontal"
                HorizontalAlignment="Center"
                Margin="0,14,0,0">
      <Button x:Name="AcceptButton"
              Click="AcceptButton_Click"
              Margin="0,0,0,0"
              IsDefault="True"
              Command="{x:Static scc:Dialog.SetDialogResultCommand}"
              CommandParameter="True"
              Style="{DynamicResource LCARS_StandardButtonStyle}">
        <AccessText Text="{s:StringResource Key=MESSAGE_DIALOG_OK, Case=Upper}" />
      </Button>
      <Button x:Name="CancelButton"
              Margin="7,0,0,0"
              IsCancel="True"
              Style="{DynamicResource LCARS_StandardButtonStyle}">
        <AccessText Text="{s:StringResource Key=MESSAGE_DIALOG_CANCEL, Case=Upper}" />
      </Button>
    </StackPanel>
  </al:AutoGrid>
</UserControl>